package org.greatstorm.dao.impl;

import org.greatstorm.dao.AlbumDao;
import org.greatstorm.dao.GeneralDao;
import org.greatstorm.entity.Album;
import org.greatstorm.entity.EntityObject;
import org.greatstorm.util.Filter;
import org.greatstorm.util.Operator;

import com.google.inject.Singleton;

@Singleton
public class AlbumDaoImpl extends GeneralDao implements AlbumDao {

	public String getEntityName() {
		return Album.KIND;
	}

	@Override
	public EntityObject getAlbumByName(String name) {
		Filter f1 = new Filter();
		f1.setKey(Album.ALBUM_NAME);
		f1.setOpt(Operator.OPT_EQUAL);
		f1.setValue(name);

		EntityObject ret = this.getUniqueEntity(f1);

		return ret;
	}

}
